package com.类加载顺序;

//变量j被赋予了i的默认值0，这一动作发生在实例变量i初始化之前和构造函数本身代码执行之前。
public class InstanceInitializer {

	private int j = getI();
	private int i = 1;

	public InstanceInitializer() {
		i = 2;
	}

	private int getI() {
		return i;
	}

	public static void main(String[] args) {
		InstanceInitializer ii = new InstanceInitializer();
		System.out.println(ii.j);
		System.out.println(ii.i);
	}

}
/*
 *  0
	2
 */